﻿define [
  'jquery'
  'use!underscore'
  'use!backbone'
  'views/album'
  'views/photo'
  'views/addPhoto'
], ($, _, Backbone, AlbumView, PhotoView, AddView) ->

  class AppRouter extends Backbone.Router
    #initialize: ->
    #  topBarView.render()

    # List of all available routes
    routes:
      ''               : 'album',
      'Photo'          : 'photo',
      'Photo/Create'   : 'addPhoto',

    album: ->
      AlbumView.render().el
      #$('#add').remove()  if $('#add').length

    photo: ->
      PhotoView.render().el

    addPhoto: ->
      newView = new AddView()
      $('.photo:first').before newView.render('edit').el
      #AddPhotoView.render().el

  new AppRouter()